﻿@inherits Blazorise.ValidationError
@if ( ParentValidation?.Status == ValidationStatus.Error )
{
    <div @ref="@ElementRef" id="@ElementId" class="@ClassNames" style="@StyleNames" role="alert" @attributes="@Attributes">
        <span class="fui-Field__validationMessageIcon">
            <svg fill="currentColor" aria-hidden="true" width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg"><path d="M6 11A5 5 0 1 0 6 1a5 5 0 0 0 0 10Zm-.75-2.75a.75.75 0 1 1 1.5 0 .75.75 0 0 1-1.5 0Zm.26-4.84a.5.5 0 0 1 .98 0l.01.09v2.59a.5.5 0 0 1-1 0V3.41Z" fill="currentColor"></path></svg>
        </span>
        @if ( ChildContent is not null )
        {
            @ChildContent
        }
        else if ( ErrorMessages is not null && ErrorMessages.Any() )
        {
            @if ( Multiline )
            {
                <OrderedList Unstyled>
                    @foreach ( var errorMessage in ErrorMessages )
                    {
                        <OrderedListItem @key="@errorMessage">@errorMessage</OrderedListItem>
                    }
                </OrderedList>
            }
            else
            {
                @string.Join( ";", ErrorMessages )
            }
        }
    </div>
}